class Raid < ActiveRecord::Base
  belongs_to :zone
  has_many :rewards, :order => "id", :dependent => :destroy
  has_many :loot, :dependent => :destroy
  has_many :signups, :order => "characters.name", :include => :character, :dependent => :destroy
  has_many :wanted_roles, :order => "roles.name", :include => :role, :dependent => :destroy

  def self.start_of_raid_week
    5.days  # too tired to figure out why this is the right number, but it works
  end

  def week 
    (self.date + Raid.start_of_raid_week).strftime("%W").to_i
  end
end
